CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(aidt)

SET (CMAKE_VERBOSE_MAKEFILE on)
SET (PROJECT_VERSION_MAJOR 1)
SET (PROJECT_VERSION_MINOR 0)
SET (PROJECT_VERSION_PATCH 5)

SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wl,-Bstatic -static-libstdc++ -static-libgcc")
SET(LINK_FLAGS "${LINK_FLAGS}")

ADD_SUBDIRECTORY(src bin)

IF (NOT DEFINED CMAKE_BINARY_DIR)
    SET(CMAKE_BINARY_DIR ${PROJECT_SOURCE_DIR}/_build)
ENDIF (NOT DEFINED CMAKE_BINARY_DIR)

if (NOT DEFINED CMAKE_INSTALL_PREFIX)
    set(CMAKE_INSTALL_PREFIX "/usr/local/aidt")
endif (NOT DEFINED CMAKE_INSTALL_PREFIX)

INCLUDE (InstallRequiredSystemLibraries)
SET (CPACK_RESOURCE_FILE_LICENSE
      "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
IF(NOT DEFINED CPACK_SYSTEM_NAME)
    SET(CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
ENDIF(NOT DEFINED CPACK_SYSTEM_NAME)

SET (CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
SET (CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
SET (CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
SET(CPACK_SOURCE_GENERATOR "TGZ;TBZ2;TZ")
INCLUDE (CPack)

INSTALL(DIRECTORY conf DESTINATION . PATTERN ".git" EXCLUDE)
